#include "widget.h"
#include "ui_widget.h"

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    connect(ui->push_button_01, &QPushButton::clicked, this, [=]() {
        // 从字体对话框中选择一种字体
        QFont font = QFontDialog::getFont(nullptr, this);

        ui->label->setFont(font);

        qDebug() << "family = " << font.family() << endl;
        qDebug() << "pixel = "<< font.pixelSize() << endl;
        qDebug() << "point = " << font.pointSize() << endl;
    });

}

Widget::~Widget()
{
    delete ui;
}

